<?php
/**
 * Created by PhpStorm.
 * User: zkc
 * Date: 2019-04-28
 * Time: 14:27
 */


$ch = curl_init();

$post_data = [
    'test' => 'bbbb',
];

$post_data = http_build_query($post_data);
$post_data = gzencode($post_data);




curl_setopt_array($ch, [
    // CURLOPT_URL            => 'http://127.0.0.1/accept-lua-filter.php',
    CURLOPT_URL            => 'http://127.0.0.1/accept-raw.php',
    CURLOPT_HEADER         => 1,
    CURLOPT_RETURNTRANSFER => 1,
    CURLOPT_POST           => 1,
    CURLOPT_HTTPHEADER     => [
        'Content-Encoding: gzip',
    ],
    CURLOPT_POSTFIELDS     => $post_data,
]);

//执行命令
$data = curl_exec($ch);
//关闭URL请求
curl_close($ch);
//显示获得的数据

echo '<pre>';
print_r($data);








